﻿using Core.DomainServices;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Insfrastructure.DomainServices
{
    public class AppConfig : IAppConfig
    {
        public string OutputFolder
        {
            get {
                var outputFolder = ConfigurationManager.AppSettings["OutputFolder"];
                return string.IsNullOrEmpty(outputFolder) ? "C:" + Path.DirectorySeparatorChar + "temp" : outputFolder.ToString();
            }
        }


        public virtual Uri GetUrl(string url)
        {
            return new Uri(url);
        }

        public virtual string GetHost(string url)
        {
            return GetUrl(url).Host;
        }
    }
}
